export default {
  install: (app) => {
    app.directive('resizeHandle', {
      mounted(el, binding, vnode, oldVnode) {
        const handle = (e)=>{
          binding.value && binding.value(e)
        }
        const object = document.createElement('object')
        object.setAttribute('aria-hidden', 'true')
        object.setAttribute('tabindex', -1)
        object.onload = handle
        object.type = 'text/html'
        object.data = 'about:blank'
        el.appendChild(object)
        object.contentDocument.defaultView.addEventListener('resize', handle)
      }
    })
  } 
}